ent = nil
dir = 1

function init(i)
    ent = i
	
end

function update(dt)
    phys = entityMngr:getEntity(ent):getAsJumpingPhysic()
	
	if phys.normalCollision.x ~= 0 and phys.collideXWithNoSlope == true then
		dir = dir * (-1)
	end
	
	phys.jumpState = phys.jumpState + phys.jumpLength * dt;

	if phys.jumpState > 1 then
		phys.jumpState = 1
	end
	
	phys.moveDirection = Vec2f(dir * phys.speed, phys.jumpSpeed*phys.jumpState)
end
